﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Data
{
    public class ForecastComment
    {
        /// <summary>
        /// 主键
        /// </summary>
        private readonly string primaryKey = "id";
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public long Add(Model.ForecastComment model)
        {
            return new DataAccess().Add<Model.ForecastComment>(model, primaryKey);
        }
        public Model.ForecastComment GetModelBysql(string sql)
        {
            return new DataAccess().Get<Model.ForecastComment>(sql);
        }
        public List<Model.ForecastComment> GetPageListWhere(int PageIndex, int PageSize, string sql, out int totalCount)
        {
            totalCount = new DataAccess().GetCount<Model.ForecastComment>(primaryKey, sql);
            return new DataAccess().GetPage_List<Model.ForecastComment>(PageIndex, PageSize, primaryKey, "addtime desc", sql);
        }
    }
}
